<?php

/**
 * Winbinder TabControl Page 
 * 
 * @package php.ui.winbinder.tab
 */


/**
 * WBTabPage
 * 
 * @package php.ui.winbinder.tab
 */

class WBTabPage extends WBObject { 
	
	private $_tabControl = null;
	private $_tabIndex = 0;
	
	/**
	 * 생성자
	 * 
	 * @param array $options
	 */
	public function __construct($options = array()) { 
		parent::__construct($options);
		
		$this->initComponent();
	}
	
	public function initComponent() { 
		if (isset($this->tabControl)) $this->_tabControl = $this->getOption('tabControl');
		if (isset($this->tabIndex)) $this->_tabIndex = $this->getOption('tabIndex');
	}
	
	public function add($options) { 
		$options['ntab'] = $this->_tabIndex;
		
		return $this->_tabControl->add($options);
	}

	public function setLayout($layout = null) { 
		$this->_tabControl->setLayout($this->_tabIndex, $layout);
	}

	public function getPanel() { 
		return $this->_tabControl->getRootPanel($this->_tabIndex);
	}
	
	public function doLayout() { 
		$panel = $this->getPanel();
		if ($panel) { 
			$panel->doLayout();
		}
	}
}

?>